package w3

import scala.collection.mutable.ArrayBuffer

object TestExec {
  def main(args: Array[String]): Unit = {
    var arr = ArrayBuffer[Int]()
    for (x <- 1 to 100)
      arr += x

    val res = getCounts(arr, 44)

    println(res.getClass)
    println(res._3)
  }

  def getCounts(arr: ArrayBuffer[Int], v: Int) = {
    var d = 0
    var e = 0
    var xx = 0
    arr.foreach(x => {
      if (x == v) e += 1 else if (x > v) d += 1 else xx += 1
    })
    Tuple3(d, e, xx)
  }
}
